package org.open.cobertura.core.data;

public class CoberturaRuntimeStore {
    private static CoberturaRuntimeStore coberturaRuntimeStore;
    private final CoberturaExecutionData coberturaExecutionData;
    private CoberturaRuntimeStore() {
        coberturaExecutionData=new CoberturaExecutionData();
    }

    /**
     * 得到运行时存储实例
     * @return
     */
    public static CoberturaRuntimeStore getInstance(){
        if(coberturaRuntimeStore==null){
            coberturaRuntimeStore=new CoberturaRuntimeStore();
        }
        return coberturaRuntimeStore;
    }

    /**
     * 存储数据
     * @param id
     * @param className
     * @param probeData
     */
    public void store(long id, String className, boolean[] probeData){
        coberturaExecutionData.put(id,className,probeData);
    }

    /**
     * 得到运行时数据
     * @return
     */
    public CoberturaExecutionData getRuntimeData(){
        return coberturaExecutionData;
    }
}
